import { createRouter, createWebHashHistory } from 'vue-router'
// import Home from '../views/Home.vue'
const Login = () => import('@/login')
const Layout = () => import('@/layout/')
const Home = () => import('@/views/home/index.vue')
const Product = () => import('@/views/product/index.vue')

const routes = [
  // 主页面路由配置
  {
    path: '/',
    component: Layout,
    children: [
      // 主页二级路由配置
      { path: '', component: Home },
      { path: '/product/:id', component: Product }
    ]
  },
  // 登录页面路由配置
  { path: '/login', component: Login }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
